package org.hyl.javabase;

import java.util.Random;


public class e1 {
	public static void main(String[] args) {
		e1 e = new e1();
		int[] a = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
		int[] b = new int[a.length];
		int n = a.length;
		// e.wuyu(a, b, n, 4);
		// hzp(a, b, n, 4);
		// funyy(a, b, n, 4);
		//hzk(a, b, n, 4);
		//ll( n, 4);
		
		
	}

	public void wuyu(int[] a, int[] b, int n, int m) {

		if (m > n) {
			System.out.println("����");
		} else {

			for (int j = 0; j < m; j++) {
				b[j] = a[n - m + j];
			}
			for (int k = m; k < n; k++) {
				b[k] = a[k - m];
			}
		}
		for (int i = 0; i < n; i++) {
			System.out.print(b[i] + " ");
		}
	}

	public static void hzp(int[] arr, int[] b, int n, int m) {

		int temp = 0;
		for (int j = 0; j < m; j++) {
			for (int k = arr.length - 2; k >= 0; k--) {
				temp = arr[k + 1];
				arr[k + 1] = arr[k];
				arr[k] = temp;
			}
		}
		for (int i = 0; i < n; i++) {
			System.out.print(arr[i]);
		}

	}

	public static void funyy(int[] a, int[] b, int n, int m) {

		for (int i = 0; i < m; i++) {
			b[i] = a[a.length - m + i];
		}
		for (int j = m; j < b.length; j++) {
			b[j] = a[j - m];
		}
		for (int i = 0; i < b.length; i++) {
			System.out.print(b[i] + "  ");
		}
	}

	public static void hzk(int[] a, int[] b, int n, int m) {

		int arr[] = new int[n];
		for (int i = 0; i < n; i++) {
			int x = (int) ((Math.random() * 100) + 1);
			arr[i] = x;
		}
		for (int i = 0; i < n; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();

		int arr1[] = new int[m];
		int j = 0;
		for (int i = (n - m); i < n; i++) {
			arr1[j] = arr[i];
			j++;
		}
		for (int i = (n - m - 1); i >= 0; i--) {
			arr[n - 1] = arr[i];
			n--;
		}
		for (int i = 0; i < m; i++) {
			arr[i] = arr1[i];
		}
		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
	}

	public static void xml(int arr2[], int arr3[], int s, int m) {
		System.out.println("����������");

		int arr[] = new int[s];
		for (int i = 0; i < s; i++) {
			int x = (int) (Math.random() * 100 + 1);
			arr[i] = x;
		}
		for (int i = 0; i < s; i++)
			System.out.print(arr[i] + " ");

	}

	public static void ll(int n,int m){
	    int[] arr = new int[n+m];
	    for(int i=0;i<n;i++){
	        arr[i]= new Random().nextInt(100) + 1;
	    }
	    System.out.print("�ƶ�֮ǰ������Ϊ��");
	    for(int i=0;i<n;i++){
	        System.out.print(arr[i]+" ");
	    }
	    for(int i=0;i<m;i++){
		for(int j=n+i;j>0;j--){
		    arr[j]=arr[j-1];
		}
	    }
	    for(int i=0;i<m;i++){
		arr[i]=arr[n+i];
	    }
	    System.out.println();
	    System.out.print("�ƶ�֮�������Ϊ��");
	    for(int i=0;i<n+m;i++){
		System.out.print(arr[i]+" ");
	    }
	}
	
	
}
